<nz-spin *ngIf="isLoading" class="modal-spin"></nz-spin>
<form nz-form *ngIf="!isLoading" [formGroup]="validateForm" (ngSubmit)="submitForm()">
  <nz-form-item>
    <nz-form-label [nzSpan]="4" nzRequired nzFor="role">邀请人</nz-form-label>
    <nz-form-control [nzSpan]="20" [nzValidateStatus]="validateForm.controls['activeRelatesId']">
      <nz-select formControlName="activeRelatesId" [nzPlaceHolder]="'邀请人'" (ngModelChange)="filterPassivityList()">
        <nz-option
          *ngFor="let option of activeList"
          [nzLabel]="option.name"
          [nzValue]="option.id">
        </nz-option>
      </nz-select>
      <nz-form-explain *ngIf="validateForm.get('activeRelatesId').dirty && validateForm.get('activeRelatesId').hasError('required')">请选择邀请人</nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="4" nzRequired nzFor="passivityRelatesId">被邀请人</nz-form-label>
    <nz-form-control [nzSpan]="20" [nzValidateStatus]="validateForm.controls['passivityRelatesId']">
      <nz-select formControlName="passivityRelatesId" [nzPlaceHolder]="'被邀请人'"  (ngModelChange)="filterActiveList()">
        <nz-option
          *ngFor="let option of passivityList"
          [nzLabel]="option.name"
          [nzValue]="option.id">
        </nz-option>
      </nz-select>
      <nz-form-explain *ngIf="validateForm.get('passivityRelatesId').dirty && validateForm.get('passivityRelatesId').hasError('required')">请选择被邀请人</nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <div class="modal-footer">
    <button nz-button type="button" (click)="close()">关闭</button>
    <button nz-button type="submit" [nzType]="'primary'" >保存</button>
  </div>
</form>
